package com.itheima.day08.myMap.test5;

import java.util.TreeMap;
import java.util.function.BiConsumer;

public class StudentDemo {
    public static void main(String[] args) {
        TreeMap<Student, String> tm = new TreeMap<>();
        Student s1 = new Student("张三", 23);
        Student s2 = new Student("李四", 24);
        Student s3 = new Student("wangwu", 24);
        tm.put(s1, "湖南");
        tm.put(s2, "北京");
        tm.put(s3, "天津");

        tm.forEach(new BiConsumer<Student, String>() {
            @Override
            public void accept(Student key, String value) {
                System.out.println(key + "---" + value);
            }
        });

    }
}
